025f27
@@ -1365,6 +1365,7 @@
public static void copyInputStreamToFile(InputStream source, File destination) t
             FileOutputStream output = openOutputStream(destination);
             try {
                 IOUtils.copy(source, output);
+                output.close(); // don't swallow close Exception if copy completes normally
             } finally {
                 IOUtils.closeQuietly(output);
             }
@@ -1728,6 +1729,7 @@
public static void writeStringToFile(File file, String data, String encoding, bo
         try {
             out = openOutputStream(file, append);
             IOUtils.write(data, out, encoding);
+            out.close(); // don't swallow close Exception if copy completes normally
         } finally {
             IOUtils.closeQuietly(out);
         }
@@ -1845,6 +1847,7 @@
public static void writeByteArrayToFile(File file, byte[] data, boolean append)
         try {
             out = openOutputStream(file, append);
             out.write(data);
+            out.close(); // don't swallow close Exception if copy completes normally
         } finally {
             IOUtils.closeQuietly(out);
         }
@@ -1959,6 +1962,7 @@
public static void writeLines(File file, String encoding, Collection<?> lines, S
         try {
             out = openOutputStream(file, append);
             IOUtils.writeLines(lines, lineEnding, out, encoding);
+            out.close(); // don't swallow close Exception if copy completes normally
         } finally {
             IOUtils.closeQuietly(out);
         }
